#pragma once

class SceneInstance;

/*--------------------------------------------------------------------------*/

struct ESplashscreen
{
	enum Type
	{
	    WindowTitle = 0,
	    Text,
	    Text_Image,
	    Text_Image_Progress
	};
};

/*--------------------------------------------------------------------------*/

struct EFontStyle
{
	enum Type
	{
	    Normal = 0,
	    Outline
	};
};

/*--------------------------------------------------------------------------*/

struct ERenderPhaseMethod
{
	enum Method
	{
	    DeferredShading = 0,
	    BackbufferColorOnly,
	    NormalRendering
	};
};

/*--------------------------------------------------------------------------*/

class IRenderPhase;

class IRenderer
{
public:
	virtual void				InitializeUniformBuffers() = 0;
	virtual GLUniformBuffer*	GetUniformBuffer(EUbo::Name name) = 0;

	virtual void				InitializeTextureBuffers() = 0;
	virtual GLTexture*			GetTextureBuffer(ETexture::Name name) = 0;

	virtual IRenderPhase*		CreateRenderPhase(const std::string& name, int priority, ERenderPhaseMethod::Method method, SceneInstance* sceneinstance, ICamera* camera, GLTexture* output) = 0;
	virtual void				ProcessPhases() = 0;

	virtual void				InitializeFont() = 0;

	/*--------------------------------------------------------------------------*/

	virtual void				SetModelMatrix(const glm::mat4& modelmatrix) = 0;
	virtual void				SetViewMatrix(const glm::mat4& viewMatrix) = 0;
	virtual void				SetProjectionMatrix(const glm::mat4& projectionMatrix) = 0;
	virtual void				UpdateModelMatrices() = 0;
	virtual void				UpdateCameraMatrices() = 0;

	/*--------------------------------------------------------------------------*/

	virtual void				ShowSplashscreen(ESplashscreen::Type type, const std::string& label, GLTexture* texture = NULL, Font* font = NULL, float progress = 0) = 0;
	virtual void				SaveScreenshot(const std::string& path) = 0;
	virtual void				SwapBuffers() = 0;

	/*--------------------------------------------------------------------------*/

	virtual void				UpdateUBOs() = 0;

	/*--------------------------------------------------------------------------*/

	virtual void				DrawRectangle2D(const glm::vec2& p1, const glm::vec2& p2, const glm::vec2& p3, const glm::vec2& p4, GLTexture* texture, const Color& color) = 0;
	virtual void				DrawRectangle2D(const glm::vec2& p1, const glm::vec2& p2, GLTexture* texture, const Color& color) = 0;
	virtual void				DrawTriangle2D(const glm::vec2& p1, const glm::vec2& p2, const glm::vec2& p3, GLTexture* texture, const Color& color) = 0;
	virtual void				DrawLine2D(const glm::vec2& p1, const glm::vec2& p2, GLTexture* texture, const Color& color) = 0;
	virtual void				DrawText2D(const Font* font, const std::string& content, const glm::vec2& position, const Color& color, EFontStyle::Type style = EFontStyle::Normal) = 0;
	/*--------------------------------------------------------------------------*/
};